package com.xdxc.model.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.xdxc.utils.JsonTypeHandler;


import com.xdxc.utils.ListLongJsonTypeHandler;
import com.xdxc.utils.LongListToStringSerializer;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;

@Data
@TableName(value = "correct_answer", autoResultMap = true)
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class CorrectAnswer {
    @JsonSerialize(using = ToStringSerializer.class)
    @TableId(value = "question_id", type = IdType.INPUT)
    private Long questionId;

    @JsonSerialize(using = LongListToStringSerializer.class)
    @TableField(  value = "option_ids" , typeHandler = ListLongJsonTypeHandler.class)
    private List<Long> optionIds;  // Assuming JSON stores an array of numbers
    private String shortAnswer;
    @TableField(typeHandler = JsonTypeHandler.class)
    private List<String> fillKeywords; // Assuming JSON stores an array of strings
    private Integer answerVersion = 1;

}
